// pages/user/recommend/recommend.js
const config = getApp().globalData.config
const T = getApp().globalData.T
let token = ''
Page({

  /**
   * 页面的初始数据
   */
  data: {
    isIos: false
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    token = getApp().globalData.token;
    let platform = getApp().globalData.platform;
    if (platform == 'ios') {
      this.setData({ isIos: true })
    }
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    this.getDetail();
  },

  getDetail() {
    T.req({
      loadTitle: '加载中...',
      url: config.api + 'recommendation/point',
      method: 'GET',
      data: {
        token: token
      },
      success: (res) => {
        this.setData({
          reward: res.reward
        })
      }
    })
  },

  onRecordCheck() {
    wx.navigateTo({
      url: '/pages/user/integral/particulars/particulars?from=recommend',
    })
  },

  onDeposit() {
    wx.navigateTo({
      url: './deposit/deposit',
    })
  }
})